<?php defined( '_JEXEC' ) or die( 'Restricted access' ); 

function mod_searchMessage(){
$view =& JFactory::getURI();
$id =& JFactory::getURI();
$message = $view->getVar('view', 'no view to be displayed', 'post','string');

//$id_message = $id->getVar('id');
$id_message = JRequest::getVar('id');

echo "<span id=\"ac_sort_message\"><h4> View is: ". $message . "</h4></span>";
echo "<span id=\"ac_sort_message\"><h4> ID is: ". $id_message . "</h4></span>";

}

?>
<?php $view_check = JRequest::getVar('view');

if ($view_check == "sort") :?>
<p>We are in Sort View so Right Module Hides :Dev Message</p>

<?php elseif ($message != 'sort') :?>
<div id="mod_ac_helper">

		<div id="ac_helper_nav_browseby_box">
			
			<div id="ac_helper_nav_browseby_title">
			<a href="<?php echo JRoute::_( 'index.php?view=category&id='.$rows[0]->catID); ?> " class="ac_helper_cat_link"><?php echo preg_replace('/(:)(.*)/', '', $rows[0]->catTITLE) ;?> </a><br/>
			
			
			<span id="lessons">Lessons&nbsp;></span></div>
		
		<div id="ac_helper_nav_browseby_links">
		
			<?php foreach ($rows as $row) : ?>
			<div id="ac_helper_nav_links"> <?php echo $row->link ;?><br/></div>
			<?php endforeach; ?>
		</div>
		
		</div>
		
		<hr/>
		
		
		<div id="mod_ac_helper_more">
		
		<?php $id_message = JRequest::getVar('id'); ?>
		<em><?php echo preg_replace('/(:)(.*)/', '', $rows[0]->catTITLE) ;?></em>&nbsp;
		<a href="index.php?view=category&id=<?php echo $url;?>&task=vocabulary">related terms</a>&nbsp;and
		<a href="index.php?view=category&id=<?php echo $url;?>&task=additional">additional resources</a> <br/>
		
		<br/>
		Download the <em><?php echo preg_replace('/(:)(.*)/', '', $rows[0]->catTITLE) ;?></em>
		<a href="#">PDF</a> of all lessons</br>
		
		</div>
		
</div><!-- end mod_ac_helper-->

<?php endif ;?>

<div id="system_message">
<?php echo $hello; ?>
<?php mod_searchMessage() ;?>
</div>